package com.isotronica.neveras.datos.daos;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;

import com.isotronica.neveras.util.vos.DatosVO;

public class DatosTempDAO extends GenericDAO<DatosVO>{
	
	public DatosTempDAO(Connection connection) {
		super(connection);
		
		creator = new CallBackCreator<DatosVO>() {
			public DatosVO create(ResultSet rs) throws SQLException {
				DatosVO vo = new DatosVO();
				vo.setIdDatos(rs.getInt("idDatos"));
				vo.setNevera_idNevera(rs.getInt("nevera_idNevera"));
				vo.setFecha(rs.getDate("fecha"));
				vo.setHora(rs.getTime("hora"));
				vo.setEnergia(rs.getBoolean("energia"));
				vo.setHumedad(rs.getDouble("humedad"));
				vo.setTemperatura(rs.getDouble("temperatura"));
				return vo;
			}

			public String getIdColumn() {
				return "idDatos";
			}
		};
		super.setCreator(creator);

	}

}
